<?php

namespace App\Model;

use App\User;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Model\UserSalesmanInviteOneYuan
 *
 * @property int $id
 * @property string|null $title 标题
 * @property string|null $content 内容
 * @property float $money 金额
 * @property int $user_id 用户id：A
 * @property int $relation_user_id 被邀请用户id：B【A邀请B】
 * @property \Illuminate\Support\Carbon|null $created_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereRelationUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereTitle($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereUserId($value)
 * @mixin \Eloquent
 * @property-read \App\User $user
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Model\UserSalesmanBonusCount $salesmanBonusCount
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanInviteOneYuan whereUpdatedAt($value)
 */
class UserSalesmanInviteOneYuan extends Model
{
    protected $table = "user_salesman_invite_one_yuan";


    /**
     * 业务员奖励金记总录表 属于哪个业务员
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function user()
    {
      return $this->belongsTo(User::class, "user_id", "id");
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function salesmanBonusCount()
    {
        return $this->belongsTo(UserSalesmanBonusCount::class, "relation_id", "id");
    }
}
